<template>
	<div class="services">
		<el-table :data="pageData.items" ref="singleTable" style="width: 100%;" highlight-current-row @row-click="rowClick">
			<el-table-column prop="serviceName" label="队伍名称"></el-table-column>
			<el-table-column prop="serviceTeamCount" label="人数"></el-table-column>
			<el-table-column prop="directorName" label="部门主管"></el-table-column>
			<el-table-column prop="serviceAddress" label="服务区域"></el-table-column>
		</el-table>
		<pagina-tion :totalNum="pageData.totalNum" @paginaClick="paginaClick"></pagina-tion>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				tableData: [],
				companyId: '',
				pageData: '',
				queryData:{
					page: 1,
					pageSize: $globalData.pageSize,
					companyId: ''
				}
			}
		},
		mounted() {
			this.companyId = this.queryData.companyId = this.$store.state.company.companyId
			this.getPageData()
		},
		methods:{
			getPageData(){
				this.$request.postForm(this.$api.queryTeamHaveTask, this.queryData).then(res=>{
					if(res.code == 200){
						this.pageData = res.data
						this.rowClick(this.pageData.items[0])
					}
				})
			},
			paginaClick(val){
				this.queryData.page = val
				this.getPageData()
			},
			rowClick(row){
				if(row){
					this.$refs.singleTable.setCurrentRow(row);
					this.$emit('tabelclick', row.id)
				}
				
				// console.log(row)
			}
		}
	}
</script>

<style scoped="scoped">
	.menberConTitle {
		width: 100%;
		background: #F3F3F3;
		text-align: left;
		padding: 5px 20px;
		margin-bottom: 20px;
		margin-top: 20px;
	}
	.tableTitle {
		font-size: 16px;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #333333;
		line-height: 30px;
	}
	.services>>>.isdelate{
		color: #F42929;
	}
</style>
